@extends('backstage.layout.master')
@section('title', '供应商列表')
@section('content')
    <style>
        a{
            cursor: pointer;
        }
    </style>
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="backstage/home">主页</a>
            </li>

            <li class="active">
                <a href="">供应商列表</a>
            </li>
        </ul><!-- .breadcrumb -->

        <div class="nav-search" id="nav-search">

        </div><!-- #nav-search -->
    </div>

    <div class="page-content">
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <div class="page-header">
                    <h1>
                        供应商列表
                        <a href="backstage/supplier/add">
                            <button class="btn btn-danger add-btn-danger" style="float: right;">添加</button>
                        </a>
                    </h1>

                </div>
                <div class="state">
                    <ul>

                    </ul>
                </div>
                <div class="table-responsive">
                    <table id="sample-table-2" class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            {{--<th class="center id">id</th>--}}
                            <th class="center">供应商名称</th>
                            <th class="center">联系人姓名</th>
                            <th class="center">联系电话</th>
                            <th class="center">类型</th>
                            <th class="center">备注</th>
                            <th class="center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach ($lists as $list)
                            <tr>
                                <td class="center">{{$list->supplier_name}}</td>
                                <td class="center">{{$list->supplier_contacts_name}}</td>
                                <td class="center">{{$list->supplier_mobile}}</td>
                                <td class="center">
                                    @if($list->supplier_type == 1)
                                        加工厂
                                    @elseif($list->supplier_type == 2)
                                        淘宝
                                    @elseif($list->supplier_type == 3)
                                        阿里巴巴
                                    @endif
                                </td>
                                <td class="center">{{$list->remark}}</td>
                                <td class="center">
                                    <div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
                                        <a class="detail"
                                           onclick="javascript:window.location.href='/backstage/supplier/detail?supplier_id={{$list->supplier_id}}';"
                                           title="查看详情" style="color:#d77600">
                                                    查看详情
                                        </a>
                                        <a class="detail"
                                           onclick="javascript:window.location.href='/backstage/supplier/delete?supplier_id={{$list->supplier_id}}';"
                                           title="删除" style="color:red">
                                                    删除
                                        </a>
                                    </div>
                                </td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                    <div class="row">
                        <div class="modal-footer no-margin-top">
                            <div class="dataTables_paginate paging_bootstrap">
                                <?php echo $lists->render(); ?>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- PAGE CONTENT ENDS -->
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.page-content -->
@stop
@section('script')
    <script type="text/javascript">
        $(function () {
            $.ajaxSetup({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                }
            });
        });


    </script>
@stop